package cn.owng.server.common.generated.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 用户资产交易记录
 * </p>
 *
 * @author baomidou
 * @since 2024-08-11
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("user_transaction")
public class UserTransaction extends Model<UserTransaction> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "user_transaction_id", type = IdType.ASSIGN_ID)
    private Long userTransactionId;

    /**
     * 用户ID
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 关联的ID, 例如: 订单Id、游戏记录Id等
     */
    @TableField("related_id")
    private Long relatedId;

    /**
     * 交易类型, 例如: 充值、游戏、任务等
     */
    @TableField("transaction_type")
    private String transactionType;

    /**
     * 资产类型, 例如: 金币、钻石等
     */
    @TableField("asset_type")
    private String assetType;

    /**
     * 资产数量
     */
    @TableField("amount")
    private Long amount;

    /**
     * 交易描述
     */
    @TableField("description")
    private String description;

    /**
     * 添加时间
     */
    @TableField("date_added")
    private Date dateAdded;

    @Override
    public Serializable pkVal() {
        return this.userTransactionId;
    }
}
